package runner;

import java.util.ArrayList;

import Algorithms.DepthSearch;
import Algorithms.WidthSearch;
import Operators.CMOperators;
import Operators.FarmerOperators;
import Operators.WaterCupOperators;
import Route.Statie;
import States.CMState;
import States.FarmerStates;
import States.StationState;
import States.WaterCupState;
import Templates.Operator;
import Templates.State;

public class MainClass {
	public static void main(String[] args)
	{
		/**  Water Cup States Initialize**/
		ArrayList<Operator<WaterCupState>> waterCupOperators=WaterCupOperators.returnOperators();
		State<WaterCupState> waterCupInitialState=WaterCupState.initalState();
		ArrayList<State<WaterCupState>> waterCupFinalState=WaterCupState.finalStates();
		/** Water Cup End **/		
		
		/** Farmer States Initialize **/
	    ArrayList<Operator<FarmerStates>> farmerOperators=FarmerOperators.returnOperators();
		State<FarmerStates> FarmerInitialState=FarmerStates.initalState();
		ArrayList<State<FarmerStates>> FarmerFinalState=FarmerStates.finalStates();
		/** Farmer End **/	
		
		/** Cannibal Missionary States Initialize **/
	    ArrayList<Operator<CMState>> CannibalMissionaryOperators=CMOperators.returnOperators();
		State<CMState> CannibalMissionaryInitialState=CMState.initalState();
		ArrayList<State<CMState>> CannibalMissionaryFinalState=CMState.finalStates();
		/** Cannibal Missionary End **/	
		
		/**  Station States Initialize**/
		//ArrayList<Operator<WaterCupState>> waterCupOperators=WaterCupOperators.returnOperators();
		State<Statie> stationInitialState=StationState.initalState();
		ArrayList<State<Statie>> stationFinalState=StationState.finalStates();
		/** Station End **/
		
		/** LogInitialize **/
		String WaterCupDepth="WaterCupDepth.txt";
		String WaterCupWidth="WaterCupWidth.txt";
		String FarmerDepth="FarmerDepth.txt";
		String FarmerWidth="FarmerWidth.txt";
		String CMDepth="CMDepth.txt";
		String CMWidth="CMWidth.txt";
		String StationDepth="StationDepth.txt";
		String StationWidth="StationWidth.txt";
		/** Log End **/
	
		/** WaterCup Execution **/
		DepthSearch<WaterCupState> waterCupDepth=new DepthSearch<WaterCupState>(waterCupInitialState,waterCupFinalState,waterCupOperators,WaterCupDepth);
		WidthSearch<WaterCupState> waterCupWidth=new WidthSearch<WaterCupState>(waterCupInitialState,waterCupFinalState,waterCupOperators,WaterCupWidth);
		waterCupDepth.executeAlgorithm();
	    waterCupWidth.executeAlgorithm();
	    /** WaterCup Execution End **/
	    
		/** Farmer Execution **/	   	
	    DepthSearch<FarmerStates> farmerDepth=new DepthSearch<FarmerStates>(FarmerInitialState,FarmerFinalState,farmerOperators,FarmerDepth);
	    WidthSearch<FarmerStates> farmerWidth=new WidthSearch<FarmerStates>(FarmerInitialState,FarmerFinalState,farmerOperators,FarmerWidth);
	    farmerDepth.executeAlgorithm();
	   	farmerWidth.executeAlgorithm();
	   	/** Farmer Execution End **/
	   	
	   	/** Cannibal Missionary Execution **/
	    DepthSearch<CMState> cannibalMissionaryDepth=new DepthSearch<CMState>(CannibalMissionaryInitialState,CannibalMissionaryFinalState,CannibalMissionaryOperators,CMDepth);
	    WidthSearch<CMState> cannibalMissionaryWidth=new WidthSearch<CMState>(CannibalMissionaryInitialState,CannibalMissionaryFinalState,CannibalMissionaryOperators,CMWidth);
	    cannibalMissionaryDepth.executeAlgorithm();
	    cannibalMissionaryWidth.executeAlgorithm();
		/** Cannibal Missionary Execution End **/
	   	
	    /** Station Execution **/
		DepthSearch<Statie> stationDepth=new DepthSearch<Statie>(stationInitialState,stationFinalState,null,StationDepth);
		WidthSearch<Statie> stationWidth=new WidthSearch<Statie>(stationInitialState,stationFinalState,null,StationWidth);
		stationDepth.executeAlgorithm();
	    stationWidth.executeAlgorithm();
	    /** Station Execution End **/
	    
	    
	    /*
	    ArrayList<Operator<FarmerStates>> operators2=FarmerOperators.returnOperators();
		State<FarmerStates> initialState2=FarmerStates.initalState();
		ArrayList<State<FarmerStates>> finalStates2=FarmerStates.finalStates();
		String logName2="DepthLog2.txt";
		DepthSearch<FarmerStates> newSearch2=new DepthSearch<FarmerStates>(initialState2,finalStates2,operators2,logName2);
	    newSearch2.executeAlgorithm();
	    
	    ArrayList<Operator<CMState>> operators3=CMOperators.returnOperators();
		State<CMState> initialState3=CMState.initalState();
		ArrayList<State<CMState>> finalStates3=CMState.finalStates();
		String logName3="DepthLog3.txt";
		DepthSearch<CMState> newSearch3=new DepthSearch<CMState>(initialState3,finalStates3,operators3,logName3);
	    newSearch3.executeAlgorithm();
		
	    ArrayList<Operator<CMState>> operators3=CMOperators.returnOperators();
		State<CMState> initialState3=CMState.initalState();
		ArrayList<State<CMState>> finalStates3=CMState.finalStates();
		String logName3="WidthLog3.txt";
		WidthSearch<CMState> newSearch1=new WidthSearch<CMState>(initialState3,finalStates3,operators3,logName3);
	    newSearch1.executeAlgorithm();*/


	}
}
